<template>
<div>
  <div class="banner" @click="handleShowGallery">
     <img
     class="banner-img" 
     :src="bannerImg" alt="">
     <div class="banner-info">
       <div class="banner-title">{{sightName}}</div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe692;</span>
          82
        </div>
     </div>
  </div>
  <common-gallery 
  @close="handleGalleryClose" 
  :imgList="gallaryImgs"
  v-show="showGallery"
  >
  </common-gallery>
</div>
  
</template>
<script>
import CommonGallery from "common/gallery/Gallery.vue";
export default {
  name: "DetailBanner",
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data() {
    return {
      showGallery: false
    };
  },
  methods: {
    handleShowGallery() {
      this.showGallery = true;
    },
    handleGalleryClose() {
      this.showGallery = false;
    }
  },
  components: {
    CommonGallery
  }
};
</script>
<style lang="stylus" scoped>
.banner {
  position: relative;
  overflow: hidden;
  height: 0;
  padding-bottom: 55%;

  .banner-img {
    width: 100%;
  }

  .banner-info {
    position: absolute;
    width: 100%;
    left: 0;
    righ: 0;
    bottom: 0;
    line-height: 0.6rem;
    color: #fff;
    display: flex;
    background: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));

    .banner-title {
      flex: 1;
      font-size: 0.32em;
      padding: 0 0.2rem;
    }

    .banner-number {
      padding: 0 0.4rem;
      height: 0.32rem;
      line-height: 0.32rem;
      font-size: 0.24rem;
      background: rgba(0, 0, 0, 0.8);
      margin-top: 0.14rem;
      border-radius: 0.2rem;

      .banner-icon {
        font-size: 0.24rem;
      }
    }
  }
}
</style>
